const Koa = require('koa');
const Router = require('koa-router');
const IndexRouter = require('./router/index')
const koaStatic = require('koa-static');
const views = require('koa-views')
const path = require('path')


const app = new Koa();
const staticPath =path.join(__dirname,'./public')
app.use(koaStatic(staticPath))

app.use(views(path.join(__dirname,'./views'),{
  extension:'ejs'
}))

var router = new Router();
router.use('/api',IndexRouter.routes())
app.use(router.routes());

app.listen(8000,()=>{
  console.log('localhost 8000..')
})
